package funcoes;

import static java.lang.Math.pow;

public class Rosenbrock implements IFuncao {

	public double calcularAptidao(double[] x)
	{
		double somatorio = 0;
		
		for (int i = 0; i< x.length - 1 ; i++) {
			somatorio += 100*pow(pow(x[i], 2) - x[i+1], 2) + pow(x[i] - 1, 2);
		}
		
		return somatorio;
	}

	public String getNome() {
		return "Rosenbrock";
	}
}
